package com.nopay.dxdwphone.dialog;

import android.app.Activity;
import android.app.Dialog;
import android.os.Bundle;
import androidx.annotation.NonNull;
import com.nopay.dxdwphone.R;

public class DialogLoginOff extends Dialog {

    private Activity mActivity;

    public DialogLoginOff(@NonNull Activity context) {
        super(context, R.style.MyDialog);
        mActivity = context;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dialog_login_off);

        findViewById(R.id.tv_dialog_cancel).setOnClickListener(v -> dismiss());
        findViewById(R.id.tv_dialog_confirm).setOnClickListener(v -> {
            dismiss();
            if(onLoginOffConfirmListener != null) onLoginOffConfirmListener.onLoginOffConfirm();
        });
    }

    private OnLoginOffConfirmListener onLoginOffConfirmListener;

    public DialogLoginOff setOnLoginOffConfirmListener(OnLoginOffConfirmListener onLoginOffConfirmListener) {
        this.onLoginOffConfirmListener = onLoginOffConfirmListener;
        return this;
    }

    public interface OnLoginOffConfirmListener {

        void onLoginOffConfirm();
    }
}
